﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_HISTORY_TECHNIC
// * CreateDate    : 2012/4/19 16:55:46
// * Creater       : CodeSmith
// * LastChangeDate: 2012/4/19 16:55:46
// * LastChanger   : 2012/4/19 16:55:46
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Prod
{
    /// <summary>
    /// ProdHistoryTechnic
    /// </summary>
    public partial class ProdHistoryTechnicBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objProdHistoryTechnicEntity">Entity</param>
        /// <returns>Entity</returns>
        public static ProdHistoryTechnicEntity GetProdHistoryTechnic(ProdHistoryTechnicEntity objProdHistoryTechnicEntity)
        {
            return DataAccess.SelectSingle<ProdHistoryTechnicEntity>(objProdHistoryTechnicEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objProdHistoryTechnicEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertProdHistoryTechnic(ProdHistoryTechnicEntity objProdHistoryTechnicEntity)
        {
            return DataAccess.Insert(objProdHistoryTechnicEntity);
        }

        public static bool InsertProdHistoryTechnic(List<ProdHistoryTechnicEntity> objProdHistoryTechnicEntityList)
        {
            return DataAccess.Insert(objProdHistoryTechnicEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objProdHistoryTechnicEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateProdHistoryTechnic(ProdHistoryTechnicEntity objProdHistoryTechnicEntity)
        {
            return DataAccess.Update(objProdHistoryTechnicEntity);
        }

        public static bool UpdateProdHistoryTechnic(List<ProdHistoryTechnicEntity> objProdHistoryTechnicEntityList)
        {
            return DataAccess.Update<ProdHistoryTechnicEntity>(objProdHistoryTechnicEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objProdHistoryTechnicEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteProdHistoryTechnic(ProdHistoryTechnicEntity objProdHistoryTechnicEntity)
        {
            return DataAccess.Delete(objProdHistoryTechnicEntity);
        }

        public static bool DeleteProdHistoryTechnic(List<ProdHistoryTechnicEntity> objProdHistoryTechnicEntityList)
        {
            return DataAccess.Delete<ProdHistoryTechnicEntity>(objProdHistoryTechnicEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetProdHistoryTechnicAll()
        {
            return DataAccess.SelectAllDataSet<ProdHistoryTechnicEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<ProdHistoryTechnicEntity> GetProdHistoryTechnicAllList()
        {
            return DataAccess.SelectAll<ProdHistoryTechnicEntity>();
        }
        #endregion

        #region Functions
        public static DataTable GetDtAllByProductID(string sProductID)
        {
            string sql = @"select * from PROD_HISTORY_TECHNIC where product_id='"+sProductID+"'";
            return DataAccess.SelectDataSet(sql).Tables[0];
        }
        #endregion
    }


}

